package net.towee.client.com.repo.view;

import net.towee.client.com.repo.presenter.RepositoryPresenter.Display;
import net.towee.client.i18n.ToweeConstants;
import net.towee.client.resources.ClientResource;

import com.google.gwt.user.client.ui.FlowPanel;
import com.google.gwt.user.client.ui.HasWidgets;
import com.google.inject.Inject;

public class RepositoryView extends FlowPanel implements Display {
	private final ClientResource resource;
	private final ToweeConstants constants;
	
	private FlowPanel explorerContainer = new FlowPanel();
	private FlowPanel showerContainer = new FlowPanel();

	@Inject
	public RepositoryView(ToweeConstants constants, ClientResource resource) {
		this.constants = constants;
		this.resource = resource;
		
		// Set CSS
		setStyleName( resource.css().repoContainer() );
		
		// Create explorer and shower
		createExplorerContainer();
		createShowerContainer();
	}
	
	private void createShowerContainer() {
		add(showerContainer);
		showerContainer.setStyleName( resource.css().repoShowerContainer() );		
	}

	private void createExplorerContainer() {
		add(explorerContainer);
		explorerContainer.setStyleName( resource.css().repoExplorerContainer() );
	}

	@Override
	public HasWidgets getExplorerContainer() {
		return explorerContainer;
	}

	@Override
	public HasWidgets getShowerContainer() {
		return showerContainer;
	}

}
